﻿<Page x:Class="SportComplex.Program.Pages.EditAddPages.EditAddSection"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:local="clr-namespace:SportComplex.Program.Pages.EditAddPages"
      mc:Ignorable="d" 
      d:DesignHeight="590" d:DesignWidth="850"
      Title="EditAddSection">

    <Grid Background="White">

        <Grid.RowDefinitions>
            <RowDefinition Height="40"/>
            <RowDefinition/>
        </Grid.RowDefinitions>

        <!--#region СЕКЦИИ-->
        <Grid Name="gridAddEditSection"
              Grid.Row="1"
              Width="500"
              Visibility="Visible"
              Height="450">

            <Grid.RowDefinitions>
                <RowDefinition/>
                <RowDefinition Height="50"/>
            </Grid.RowDefinitions>

            <!--Элементы в GroupBox-->
            <GroupBox Header="Добавление / Редактирование секции"
                      FontSize="20"
                      BorderBrush="Black"
                      BorderThickness="3">

                <Grid Margin="10">

                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="200"/>
                        <ColumnDefinition/>
                    </Grid.ColumnDefinitions>

                    <Grid.RowDefinitions>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                    </Grid.RowDefinitions>

                    <!--Название секции-->
                    <TextBlock Text="Название"
                               VerticalAlignment="Center"
                               HorizontalAlignment="Right"/>
                    <TextBox Name="InputNameSectionTxb"
                             Text="{Binding name}"
                             Grid.Column="1"
                             Margin="20"
                             Background="WhiteSmoke"/>

                    <!--Длительность-->
                    <TextBlock Grid.Row="1"
                               Text="Длительность (Мин.)"
                               VerticalAlignment="Center"
                               HorizontalAlignment="Right"/>
                    <TextBox Name="InputDurationSectionTxb"
                             Text="{Binding duration}"
                             Grid.Row="1"
                             Grid.Column="1"
                             Margin="20"
                             Background="WhiteSmoke"/>

                    <!--Фото-->
                    <TextBlock Grid.Row="2"
                               Text="Фото (Путь)"
                               VerticalAlignment="Center"
                               HorizontalAlignment="Right"/>
                    <TextBox Name="InputPhotoSectionTxb"
                             Text="{Binding photo}"
                             Grid.Row="2"
                             Grid.Column="1"
                             Margin="20"  
                             Width="150"
                             HorizontalAlignment="Left"
                             Background="WhiteSmoke"/>
                    <Button Name="ChangeImageSectionBtn"
                            Grid.Row="2"
                            Grid.Column="1"
                            Content="Сменить"
                            FontSize="15"
                            VerticalAlignment="Center"
                            HorizontalAlignment="Left"
                            Margin="175,0,0,0" 
                            Height="29" 
                            Width="73"
                            Click="ChangeImageSectionBtn_Click"/>

                    <!--Стоимость-->
                    <TextBlock Grid.Row="3"
                               Text="Стоимость (Руб.)"
                               VerticalAlignment="Center"
                               HorizontalAlignment="Right"/>
                    <TextBox Name="InputCostSectionTxb"
                             Text="{Binding cost}"
                             Grid.Row="3"
                             Grid.Column="1"
                             Margin="20"
                             Background="WhiteSmoke" 
                             KeyDown="InputCostSectionTxb_KeyDown"/>

                    <!--Скидка-->
                    <TextBlock Grid.Row="4"
                               Text="Скидка (%)"
                               VerticalAlignment="Center"
                               HorizontalAlignment="Right"/>
                    <TextBox Name="InputDiscountSectionTxb"
                             Text="{Binding discount}"
                             Grid.Row="4"
                             Grid.Column="1"
                             Margin="20"
                             Background="WhiteSmoke"
                             KeyDown="InputDiscountSectionTxb_KeyDown"/>

                </Grid>

            </GroupBox>

            <!--Сохранение-->
            <Button Name="SaveSectionBtn"
                    Grid.Row="1"
                    Content="Сохранить"
                    FontSize="20"
                    Margin="10"
                    HorizontalAlignment="Center"
                    Width="200"
                    Click="SaveSectionBtn_Click"/>

        </Grid>
        <!--#endregion СЕКЦИИ-->

        <!--Вернуться на страницу -->
        <Button Name="BackBtn"
                Content="Назад"
                FontSize="20"
                Margin="5" 
                Click="BackBtn_Click"/>
        
    </Grid>
    
</Page>
